Release 10.1A: OpenEdge Development:
ADM and SmartObjects
Using GroupAssign SmartLinks
GroupAssign SmartLinks are intended for grouping updates in multiple SmartDataViewers into one transaction. To do this, you link a master SmartDataViewer to the SmartDataObject with an Update SmartLink, use GroupAssigns to link this SmartDataViewer to the other SmartDataViewers that will be grouped with it. When the updateRecord procedure executes, the
collectChangesprocedure runs for the master SmartDataViewer, to collect changed field values from all its GroupAssign-Targets. The collected changes serve as the input to thesubmitRowprocedure in the data source that updates the database. Figure 6–6 illustrates this process. The arrows in the figure indicate SmartLinks.Figure 6–6: Grouping updates with GroupAssign SmartLinks
![]()
Note the SmartLinks in Figure 6–6:
- The Customer SmartDataObject is linked to each Customer SmartDataViewer with a Data SmartLink.
- The master SmartDataViewer is linked to the SmartDataObject with an Update link.
- The master SmartDataViewer is linked to each of the other SmartDataViewers, in a star pattern, with a GroupAssign SmartLink.
- The Update SmartPanel is linked to the master SmartDataViewer with a TableIO SmartLink.
The following example, which uses the Customer table in the Progress sample database, links various SmartDataViewers with GroupAssign SmartLinks so that the application can update a single customer record across multiple SmartDataViewers. Follow these steps:
![]()
To update a single customer record across multiple SmartDataViewers:
- Create a SmartDataObject for the Customer table.
- Create a SmartDataViewer for the Customer table that contains the following fields:
- Create a second SmartDataViewer for Customer table that contains the following fields:
- Create a SmartWindow and on it create a SmartFolder with two tabs, labeled Contact and Address.
- Drop the SmartDataObject onto the window.
- Drop the
vcustcontact.wSmartDataViewer (the master SmartDataViewer) onto page 1 of the SmartWindow and link it to the SmartDataObject with Data and Update links.- Drop the
vcustaddress.wSmartDataViewer onto page 2 of the SmartWindow and add SmartLinks as follows:- Drop an Update SmartPanel onto page 0 of the window and link it to the
vcustcontact.w(master) SmartDataViewer.When this application is run, it can make updates to a single record through both SmartDataViewers. These updates are saved together, updating the database with all changes to a single customer record in one transaction.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |